#!/bin/bash
set -e
set -x
MYDIR="${0%/*}"
cd "$MYDIR/.."
source "recipes/common.sh"


# RECIPE START findutils-static

reset_mtime findutils findutils/configure.ac
rm -rf build/findutils-static
mkdir -p build/findutils-static
cd build/findutils-static
cat > config.cache <<-EOF
gl_cv_func_wcwidth_works=yes
ac_cv_func_fnmatch_gnu=yes
EOF
../../findutils/configure \
	${CONFIGURE_ARGS} \
	--cache-file=config.cache \
	--disable-silent-rules \
	--disable-nls \
	--disable-threads \
	${AUTOCRAP_KLUDGE}

make -j${JOBS}
rm -f find/find
make -j${JOBS} -C find find LDFLAGS="$LDFLAGS -static"

mkdir -p "${stage}${prefix}/bin"
cp -a find/find "${stage}${prefix}/bin/find.static"

cd ../..
rm -rf build/findutils-static

# RECIPE END findutils-static
